home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / ipack.exe / UDPPEERB.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-03-20  |  3.1 KB  |  108 lines

  1. VERSION 4.00
  2. Begin VB.Form UDPPeerB 
  3.    Caption         =   "UDPPeerB"
  4.    ClientHeight    =   3780
  5.    ClientLeft      =   5355
  6.    ClientTop       =   1515
  7.    ClientWidth     =   4020
  8.    Height          =   4185
  9.    KeyPreview      =   -1  'True
  10.    Left            =   5295
  11.    LinkTopic       =   "UDPPeerB"
  12.    LockControls    =   -1  'True
  13.    ScaleHeight     =   3780
  14.    ScaleWidth      =   4020
  15.    Top             =   1170
  16.    Width           =   4140
  17.    Begin VB.ListBox lstTranscript 
  18.       Height          =   2400
  19.       Left            =   120
  20.       TabIndex        =   1
  21.       Top             =   360
  22.       Width           =   3735
  23.    End
  24.    Begin VB.TextBox txtSend 
  25.       Height          =   375
  26.       Left            =   120
  27.       TabIndex        =   0
  28.       Top             =   3240
  29.       Width           =   3735
  30.    End
  31.    Begin VB.Label Label1 
  32.       Caption         =   "Transcript:"
  33.       Height          =   255
  34.       Left            =   120
  35.       TabIndex        =   3
  36.       Top             =   120
  37.       Width           =   735
  38.    End
  39.    Begin VB.Label Label2 
  40.       Caption         =   "Enter message here then press Enter:"
  41.       Height          =   255
  42.       Left            =   120
  43.       TabIndex        =   2
  44.       Top             =   3000
  45.       Width           =   2655
  46.    End
  47.    Begin AsocketLib.AsyncSocket ASocket1 
  48.       Left            =   3120
  49.       Top             =   2760
  50.       _Version        =   327680
  51.       _ExtentX        =   847
  52.       _ExtentY        =   847
  53.       _StockProps     =   0
  54.       ReceiveBufferSize=   8192
  55.       SendBufferSize  =   8192
  56.       BroadcastEnabled=   0   'False
  57.       LingerEnabled   =   0   'False
  58.       RouteEnabled    =   -1  'True
  59.       KeepAliveEnabled=   0   'False
  60.       OutOfBandEnabled=   0   'False
  61.       ReuseAddressEnabled=   0   'False
  62.       TCPNoDelayEnabled=   0   'False
  63.       LingerMode      =   0
  64.       LingerTime      =   0
  65.       EventMask       =   63
  66.       LocalPort       =   1002
  67.       RemotePort      =   1001
  68.       SocketType      =   1
  69.       LocalAddress    =   ""
  70.       RemoteName      =   ""
  71.       RemoteAddress   =   ""
  72.       ReceiveTimeout  =   -1
  73.       SendTimeout     =   -1
  74.    End
  75. Attribute VB_Name = "UDPPeerB"
  76. Attribute VB_Creatable = False
  77. Attribute VB_Exposed = False
  78. Private Sub Form_KeyPress(KeyAscii As Integer)
  79.     If (KeyAscii = 13) Then
  80.         If (txtSend.Text <> "") Then
  81.             lstTranscript.AddItem "send: " & txtSend.Text
  82.             ASocket1.SendBuffer = txtSend.Text
  83.             ASocket1.SendTo
  84.             txtSend.Text = ""
  85.         End If
  86.         KeyAscii = 0
  87.     End If
  88. End Sub
  89. Private Sub ASocket1_OnReceive(ByVal ErrorCode As Integer)
  90.     lstTranscript.AddItem "recv: " & ASocket1.Receive
  91. End Sub
  92. Private Sub Form_Load()
  93.     ASocket1.Create
  94.     '
  95.     ' Workaround for version 5.00.004
  96.     '
  97.     If (ASocket1.Version = "5.00.004") Then
  98.         On Error Resume Next
  99.         ASocket1.Bind
  100.         If (Err And Err <> 10022) Then
  101.             MsgBox "Unexpected error: " & Error
  102.         End If
  103.         On Error Resume Next
  104.     Else
  105.         ASocket1.Bind
  106.     End If
  107. End Sub
  108.